package com.lovo.ssc.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lovo.ssc.entity.Customer;
import com.lovo.ssc.mapper.CustomerMapper;
import com.lovo.ssc.service.ICustomerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 客户表 服务实现类
 * </p>
 *
 * @author lovo
 * @since 2022-07-07
 */
@Service
public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> implements ICustomerService {

    @Override
    public IPage<Customer> findAll(int currentPage, int pageSize) {
        IPage<Customer> page = new Page<>();
        page.setCurrent(currentPage);
        page.setSize(pageSize);

        return baseMapper.findAll(page);
    }

    @Override
    public void updateState(String userName, String state) {
        baseMapper.updateState(userName, state);
    }

    @Override
    public void updateGrade(String userName, String grade) {
        baseMapper.updateGrade(userName, grade);
    }
}
